//
//  StringTool.swift
//  ML
//
//  Created by MoneyLee on 2020/8/21.
//  Copyright © 2020 MoneyLee. All rights reserved.
//

import UIKit

struct StringTool {
    
    func printUsigString(fileName: String, fileType: String) -> String {
        
        let path = Bundle.main.path(forResource: fileName, ofType: fileType)
        let url = URL(fileURLWithPath: path!)
        do {
            let data = try Data(contentsOf: url)
            let str =  NSString(data:data ,encoding: String.Encoding.utf8.rawValue)! as String
            let result : Array = str.components(separatedBy: "', '")
            for item in result {
                print(item)
            }
            return str
            
        } catch {
            print("读取本地数据出现错误: \(error.localizedDescription)")
        }
        return "获取失败"
    }
    
    

}
